import { http } from "@/utils"
import { GET_USER_INFO } from "../constants"
export const getUserInfo = () => {
  return async (dispatch, getSate) => {
    const res = await http.get("/user/profile", {
      headers: {
        Authorization: `Bearer ${getSate().login}`,
      },
    })
    dispatch({ type: GET_USER_INFO, payload: res.data.data })
  }
}
